List page: relationship cell labels via the shared label seam#639
Merged
Conversation
…label seam
ListView now resolves each relationship value to { id, label } server-side
via getItemLabel (honouring a related list's ui.labelField) before crossing
the server/client boundary, instead of ListViewClient/utils.ts deriving a
label from an inline name → title → label → id chain that had drifted from
the item form's relationship-option labels.
Closes #632
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: d22508d The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
Author
Self-reviewReviewed the diff for correctness and scope against the acceptance criteria in #632. Findings: none blocking. Design notes for reviewers:
Verification:
Generated by Claude Code |
Contributor
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Contributor
Coverage Report for UI Package Coverage (./packages/ui)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Contributor
Coverage Report for CLI Package Coverage (./packages/cli)
File CoverageNo changed files found. |
Contributor
Coverage Report for Auth Package Coverage (./packages/auth)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Contributor
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ListView(the built-in admin list page's server component) now resolves each relationship cell value to{ id, label }via the shared label seam (getItemLabel) before it crosses the server/client boundary toListViewClient— honouring a related list's configuredui.labelField, and matching the same resolver already used for relationship-option labels in the item edit form (relationship-options.ts).name → title → label → idderivation (getRelationshipDisplayValue) frompackages/ui/src/lib/utils.ts.getFieldDisplayValueno longer special-cases'relationship'— that display logic now depends on a related list's config, which only the server component has.ListTablecomponent (embedded directly by consumers with raw items and no list config) keeps its own local, unexported fallback for relationship display, since it never had access to any list config to resolveui.labelFieldagainst. This keeps it working without depending on the now-removed shared chain inutils.ts.Test plan
packages/ui/tests/components/ListView.test.tsxcovering: defaultnamefallback, a configuredui.labelField, many-relationships resolving to an array of{ id, label }, falling back toidwhen the label field is stripped (e.g. by access control), andnull/empty relationships resolving tonull.packages/ui/tests/components/ListViewClient.test.tsxrelationship fixtures to the new pre-resolved{ id, label }shape.pnpm testinpackages/ui— 215 tests passing.pnpm buildinpackages/ui— typechecks cleanly.pnpm lint— no new warnings/errors.@opensaas/stack-uipatch).Closes #632
Generated by Claude Code